package com.kukudexin.time.mayikt.stream;

import java.time.Duration;
import java.time.Instant;
import java.util.Date;

/**
 * @author: 酷酷的鑫
 * @Date: 2022/1/12 14:41
 * @description:
 */
public class NowDurationTest {
    public static void main(String[] args) {
        Instant start = Instant.now();
        long l = Instant.now().toEpochMilli();
        System.out.println(l);
//        long sum = 0;
//        for (long i = 0; i < 50000000000L; i++) {
//            sum += i;
//        }
        long l1 = System.currentTimeMillis();
        System.out.println(l1);
//        System.out.println(sum);
        Instant end = Instant.now();
        System.out.println("五百亿求和花费的时间为: " + Duration.between(start, end).toMillis());
    }
}
